<template>
	<view class="header">
		<image :src="productInfo.image"></image>
	</view>
	<view>
		<uni-section type="line" :title="productInfo.adname">
			<view style="padding: 0 30rpx">
				{{ productInfo.addesc }}
			</view>
		</uni-section>
		<uni-section type="line" title="价格">
			<view style="padding: 0 30rpx">${{ productInfo.money }}</view>
		</uni-section>
		<uni-section type="line" title="联系人">
			<view style="padding: 0 30rpx">
				{{ productInfo.phone }}
			</view>
		</uni-section>
	</view>
</template>

<script>
export default {
	data() {
		return {
			productId: '',
			productInfo: {}
		};
	},
	onLoad(e) {
		// console.log(e.id)
		this.productId = e.id;
		this.getProductDetail();
	},
	methods: {
		getProductDetail() {
			this.$http.get(this.$api.productDetail.url + '/' + this.productId, {}).then((res) => {
				console.log(res);
				this.productInfo = res.result;
			});
		}
	}
};
</script>

<style lang="scss">
.header {
	width: 100%;

	image {
		width: 100%;
	}
}
</style>
